//
//  WRNavigationBar+ZQAdd.m
//  shenmgmi
//
//  Created by Morplcp on 2018/12/28.
//  Copyright © 2018 Morplcp. All rights reserved.
//

#import "WRNavigationBar+ZQAdd.h"
#import "Aspects.h"

@implementation WRNavigationBar (ZQAdd)
//+ (CGFloat)navBarBottom {
//    return [self isIphoneX] ? 88 : 64;
//}
//+ (CGFloat)tabBarHeight {
//    return [self isIphoneX] ? 83 : 49;
//}

+ (void)load
{
    Class catMetal = objc_getMetaClass(NSStringFromClass(WRNavigationBar.class).UTF8String);
    [catMetal aspect_hookSelector:NSSelectorFromString(@"navBarBottom") withOptions:(AspectPositionInstead) usingBlock:^(id<AspectInfo> info)
     {
         NSInvocation *inv = info.originalInvocation;
         CGFloat result = [WRNavigationBar zq_navBarBottom];
         [inv setReturnValue:&result];
     } error:nil];
    
    [catMetal aspect_hookSelector:NSSelectorFromString(@"tabBarHeight") withOptions:(AspectPositionInstead) usingBlock:^(id<AspectInfo> info)
     {
         NSInvocation *inv = info.originalInvocation;
         CGFloat result = [WRNavigationBar zq_tabBarHeight];
         [inv setReturnValue:&result];
     } error:nil];
}

+ (CGFloat)zq_navBarBottom
{
    return NAVBAR_HEIGHT;
}

+ (CGFloat)zq_tabBarHeight
{
    return TABBAR_HEIGHT;
}

@end
